<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use shopend\assets\ShopAsset;
use common\service\CommonService;

StaticService::includeAppJsStatic(GlobalUrlService::buildShopStaticUrl('/backend/order/order-index.js'),ShopAsset::class);
?>
<div class="layui-card">
    <div class="layui-card-header">订单列表</div>
    <div class="layui-card-body">
        <form class="layui-form" id="serch-form">
            搜索类型:
            <div class="layui-inline">
                <select tabindex="1" name="search_type" class="search_type">
                    <option value="">请选择搜索类型</option>
                    <option value="1">按手机号搜索</option>
                    <option value="2">按收货人搜索</option>
                </select>
            </div>
            <div class="layui-inline">
                <input type="text" id="addressee_name" name="addressee_name" class="layui-input" value=""/>
            </div>
            订单状态:
            <div class="layui-inline">
                <select class="span2 select order_status" data-placeholder="Choose a Category" tabindex="1" name="order_status">
                    <option value="0">请选择订单状态</option>
                    <option value="1" <?php if($status == 1):?>selected="selected"<?php endif;?>>待付款</option>
                    <option value="2" <?php if($status == 2):?>selected="selected"<?php endif;?>>待发货</option>
                    <option value="4" <?php if($status == 4):?>selected="selected"<?php endif;?>>待收货</option>
                    <option value="5" <?php if($status == 5):?>selected="selected"<?php endif;?>>退款中</option>
                    <option value="6" <?php if($status == 6):?>selected="selected"<?php endif;?>>已完成</option>
                    <option value="7" <?php if($status == 7):?>selected="selected"<?php endif;?>>已关闭</option>
                    <option value="8" <?php if($status == 8):?>selected="selected"<?php endif;?>>拼团中</option>
                </select>
            </div>
            <br/><br/>
            下单时间:
            <div class="layui-inline">
                <input type="text" id="start_time" name="start_time" class="layui-input" placeholder="开始时间" />
            </div>
            <div class="layui-inline">
                <input type="text" id="end_time" name="end_time" class="layui-input" placeholder="截止时间" />
            </div>
            <div class="layui-inline">
                <button class="layui-btn" lay-submit lay-filter="serch-form"><i class="layui-icon">&#xe615;</i>搜索</button>
            </div>
        </form>
        <table class="layui-hide" id="userTable" lay-filter="operation" lay-data="{id:'list'}"></table>
        <script type="text/html" id="operation">
            {{# if(d.order_status == 4){ }}
            <a class="layui-btn layui-btn-xs" lay-event="refund">退款</a>
            {{# }else if(d.order_status == 1){ }}
            <a class="layui-btn layui-btn-xs" lay-event="send">发货</a>
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
            {{# } }}
            <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
        </script>
    </div>
</div>
